home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Camelot / Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].zip / Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].adf / XLisp-Stat / Functions / identifypoint.lsp < prev    next >
Text File  |  1990-10-11  |  790b  |  23 lines

  1. ; book pp.276-277
  2.  
  3. (send graph-proto :add-mouse-mode 'identify
  4.    :title "Identify"
  5.    :click :do-identify
  6.    :cursor 'finger)
  7.  
  8. (defmeth graph-proto :do-identify (x y m1 m2)
  9.   (let* ((cr (send self :click-range))
  10.           (p (first (send self :points-in-rect
  11.                           (- x (round (/ (first cr) 2)))
  12.                           (- y (round (/ (second cr) 2)))
  13.                           (first cr)
  14.                           (second cr)))))
  15.     (if p
  16.         (let ((mode (send self :draw-mode))
  17.               (label (send self :point-label p)))
  18.           (send self :draw-mode 'xor)
  19.           (send self :draw-string label x y)
  20.           (send self :while-button-down #'(lambda (x y) nil))
  21.           (send self :draw-string label x y)
  22.           (send self :draw-mode mode)))))
  23.